package snapex.core.mapper.ext;

import static org.mybatis.dynamic.sql.SqlBuilder.isEqualTo;
import static snapex.core.mapper.EmployeeInfoDynamicSqlSupport.createTimestamp;
import static snapex.core.mapper.EmployeeInfoDynamicSqlSupport.emailAddress;
import static snapex.core.mapper.EmployeeInfoDynamicSqlSupport.employeeInfo;
import static snapex.core.mapper.EmployeeInfoDynamicSqlSupport.hashKey;
import static snapex.core.mapper.EmployeeInfoDynamicSqlSupport.staffId;

import javax.annotation.Generated;

import org.apache.ibatis.annotations.Mapper;
import org.mybatis.dynamic.sql.select.SelectDSL;

import snapex.core.mapper.EmployeeInfoMapper;
import snapex.core.model.EmployeeInfo;

@Mapper
public interface EmployeeInfoMapperExt extends EmployeeInfoMapper {
	
    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    default EmployeeInfo selectByHashKey(String hashKey_) {
        return SelectDSL.selectWithMapper(this::selectOne, staffId, emailAddress, hashKey, createTimestamp)
                .from(employeeInfo)
                .where(hashKey, isEqualTo(hashKey_))
                .build()
                .execute();
    }
}
